package com.mspbots.core.bot.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mspbots.core.AbstractBaseController;
import com.mspbots.core.bot.model.TenantBot;
import com.mspbots.core.bot.service.TenantBotService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

/**
 * com.mspbots.core.bot.controller.TenantBotController
 *
 * @author Jason
 * @date 2019/12/20
 **/
@RestController
@RequestMapping("tenant-bot")
public class TenantBotController extends AbstractBaseController<TenantBot, TenantBotService> {


    @Override
    @GetMapping("page")
    public Callable selectPage(Page<TenantBot> page, TenantBot queryParams) {
        return () -> service.page(page, queryParams);
    }

    @Override
    @GetMapping(path = "/{id}/info")
    public Callable selectById(@PathVariable Long id) {
        return () -> service.info(id);
    }

}
